home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-09-13 | 5.6 KB | 145 lines | [TEXT/CCL2] |
-
- (in-package :TRAPS) ;
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // OPEN SCRIPTING ARCHITECTURE: Client Interface
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // Copyright © 1992 Apple Computer, Inc. All rights reserved.
- ; // Authors: Jens Alfke, William Cook, Donn Denman, and Warren Harris
- ; ////////////////////////////////////////////////////////////////////////////////
- ; // This interface defines what it means to be a "scripting component."
- ; // Scripting components allow "scripts" to be loaded and executed. This
- ; // interface does not define the way in which a particular scripting
- ; // component's scripts are editing and debugged.
- ; ////////////////////////////////////////////////////////////////////////////////
- ;
-
- ; $IFC UNDEFINED UsingIncludes
- ; $SETC UsingIncludes := 0
- ; $ENDC
-
- ; $IFC NOT UsingIncludes
-
- ; $ENDC
-
- ; $IFC UNDEFINED UsingAppleScript
- ; $SETC UsingAppleScript := 1
-
- ; $I+
- ; $SETC AppleScriptIncludes := UsingIncludes
- ; $SETC UsingIncludes := 1
- ; $IFC UNDEFINED UsingAppleEvents
-
- (require-interface 'APPLEEVENTS); $I $$Shell(PInterfaces)AppleEvents.p
- ; $ENDC
- ; $IFC UNDEFINED UsingComponents
-
- (require-interface 'COMPONENTS) ; $I $$Shell(PInterfaces)Components.p
- ; $ENDC
- ; $IFC UNDEFINED UsingOSA
-
- (require-interface 'OSA) ; $I $$Shell(PInterfaces)OSA.p
- ; $ENDC
- ; $IFC UNDEFINED UsingTextEdit
-
- (require-interface 'TEXTEDIT) ; $I $$Shell(PInterfaces)TextEdit.p
- ; $ENDC
- ; $SETC UsingIncludes := AppleScriptIncludes
-
- ; Types and Constants
-
- (defconstant $typeAppleScript :|ascr|)
- (defconstant $kAppleScriptSubtype #$TYPEAPPLESCRIPT)
- (defconstant $typeASStorage #$TYPEAPPLESCRIPT)
-
- ; Error Codes
-
- ; Runtime errors
- (defconstant $errASCantConsiderAndIgnore -2720)
- (defconstant $errASCantCompareMoreThan32k -2721)
-
- ; Compiler errors
- (defconstant $errASTerminologyNestingTooDeep -2760)
- (defconstant $errASIllegalFormalParameter -2761)
- (defconstant $errASParameterNotForEvent -2762)
- (defconstant $errASNoResultReturned -2763)
-
- ; Dialect specific errors
- ; The range -2780 thru -2799 is reserved for dialect specific error codes.
- ; (Error codes from different dialects may overlap.)
-
- ; English errors
- (defconstant $errASInconsistentNames -2780)
-
- ; Component Selectors
- (defconstant $kASSelectInit #X1001)
- (defconstant $kASSelectSetSourceStyles #X1002)
- (defconstant $kASSelectGetSourceStyles #X1003)
- (defconstant $kASSelectGetSourceStyleNames #X1004)
-
- ; OSAGetScriptInfo Selectors
- (defconstant $kASHasOpenHandler :|hsod|)
-
- ; Initialization
-
-
- (deftrap _asinit ((scriptingcomponent (:pointer :componentinstancerecord)) (modeflags :signed-long) (minstacksize :signed-long) (preferredstacksize :signed-long) (maxstacksize :signed-long) (minheapsize :signed-long) (preferredheapsize :signed-long) (maxheapsize :signed-long))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent modeflags minstacksize preferredstacksize maxstacksize minheapsize preferredheapsize maxheapsize ((+ (ash 28 16) 4097) :signed-longint)))
-
- ; Default Initialization Parameters
-
- (defconstant $kASDefaultMinStackSize 4096)
- (defconstant $kASDefaultPreferredStackSize 16384)
- (defconstant $kASDefaultMaxStackSize 16384)
- (defconstant $kASDefaultMinHeapSize 4096)
- (defconstant $kASDefaultPreferredHeapSize 16384)
- (defconstant $kASDefaultMaxHeapSize 33554432)
-
- ; Source Styles
-
-
- (deftrap _assetsourcestyles ((scriptingcomponent (:pointer :componentinstancerecord)) (sourcestyles (:handle :testyletable)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent sourcestyles ((+ (ash 4 16) 4098) :signed-longint)))
-
-
- (deftrap _asgetsourcestyles ((scriptingcomponent (:pointer :componentinstancerecord)) (resultingsourcestyles (:pointer (:handle :testyletable))))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent resultingsourcestyles ((+ (ash 4 16) 4099) :signed-longint)))
-
-
- (deftrap _asgetsourcestylenames ((scriptingcomponent (:pointer :componentinstancerecord)) (modeflags :signed-long) (resultingsourcestylenameslist (:pointer :aedesc)))
- (:stack :signed-long)
- (:stack-trap #xA82A :d0 0 scriptingcomponent modeflags resultingsourcestylenameslist ((+ (ash 8 16) 4100) :signed-longint)))
-
- (defconstant $kASSourceStyleUncompiledText 0)
- (defconstant $kASSourceStyleNormalText 1)
- (defconstant $kASSourceStyleLanguageKeyword 2)
- (defconstant $kASSourceStyleApplicationKeyword 3)
- (defconstant $kASSourceStyleComment 4)
- (defconstant $kASSourceStyleLiteral 5)
- (defconstant $kASSourceStyleUserSymbol 6)
- (defconstant $kASSourceStyleObjectSpecifier 7)
- (defconstant $kASNumberOfSourceStyles 8)
-
- ; $ENDC ; UsingAppleScript
-
- ; $IFC NOT UsingIncludes
-
- ; $ENDC
-
- (export '($KASNUMBEROFSOURCESTYLES $KASSOURCESTYLEOBJECTSPECIFIER
- $KASSOURCESTYLEUSERSYMBOL $KASSOURCESTYLELITERAL
- $KASSOURCESTYLECOMMENT $KASSOURCESTYLEAPPLICATIONKEYWORD
- $KASSOURCESTYLELANGUAGEKEYWORD $KASSOURCESTYLENORMALTEXT
- $KASSOURCESTYLEUNCOMPILEDTEXT $KASDEFAULTMAXHEAPSIZE
- $KASDEFAULTPREFERREDHEAPSIZE $KASDEFAULTMINHEAPSIZE
- $KASDEFAULTMAXSTACKSIZE $KASDEFAULTPREFERREDSTACKSIZE
- $KASDEFAULTMINSTACKSIZE $KASHASOPENHANDLER
- $KASSELECTGETSOURCESTYLENAMES $KASSELECTGETSOURCESTYLES
- $KASSELECTSETSOURCESTYLES $KASSELECTINIT $ERRASINCONSISTENTNAMES
- $ERRASNORESULTRETURNED $ERRASPARAMETERNOTFOREVENT
- $ERRASILLEGALFORMALPARAMETER $ERRASTERMINOLOGYNESTINGTOODEEP
- $ERRASCANTCOMPAREMORETHAN32K $ERRASCANTCONSIDERANDIGNORE
- $TYPEASSTORAGE $KAPPLESCRIPTSUBTYPE $TYPEAPPLESCRIPT))
- (provide-interface 'AppleScript)